<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <title>admin</title>

    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="/favicon.ico"/>
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html"/>
    <![endif]-->

    <link rel="stylesheet" type="text/css" href="/static/css/admin/bootstrap.min14ed.css"/>
    <link rel="stylesheet" type="text/css" href="/static/css/admin/font-awesome.min93e3.css"/>
    <link rel="stylesheet" type="text/css" href="/static/css/admin/plugins/dataTables/dataTables.bootstrap.css">
    <link rel="stylesheet" type="text/css" href="/static/css/admin/animate.min.css"/>
    <link rel="stylesheet" type="text/css" href="/static/css/admin/style.min862f.css"/>
    <link href="/static/css/admin/admincommon.css?v=20180820" rel='stylesheet' type='text/css'/>

    <style type="text/css">

        .select-box {
            border: solid 1px #ddd;
            box-sizing: border-box;
            vertical-align: middle;
            width: 20%;
            display: inline-block
        }

        .select {
            border: solid 1px #ddd;
            box-sizing: border-box;
            cursor: pointer;
            line-height: normal;
            font-weight: normal;
            width: 100%;
            white-space: nowrap
        }

        .select-box .select {
            border: none
        }

        .select-box.inline, .select-box.inline .select {
            width: auto
        }

        .select-box, .select-box.size-M {
            padding: 4px 5px
        }

        .select, .size-M .select {
            font-size: 14px
        }

        .select-box.size-MINI {
            padding: 0px 5px
        }

        .size-MINI .select {
            font-size: 12px
        }

        .select-box.size-S {
            padding: 3px 5px
        }

        .size-S .select {
            font-size: 12px
        }

        .select-box.size-L {
            padding: 8px 5px
        }

        .size-L .select {
            font-size: 16px
        }

        .select-box.size-XL {
            padding: 10px 5px
        }

        .size-XL .select {
            font-size: 18px
        }

        @media (max-width: 767px) {
            .responsive .select-box {
                border: none
            }

            .responsive .select-box .select,
            .responsive .select {
                border: solid 1px #ddd;
                padding: 10px;
                font-size: 16px
            }

            .responsive .select-box,
            .responsive .select-box.size-M,
            .responsive .select-box.size-MINI,
            .responsive .select-box.size-S,
            .responsive .select-box.size-L,
            .responsive .select-box.size-XL {
                height: auto;
                padding: 0
            }
        }
    </style>
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>充值列表</h5>
                    <div class="ibox-tools">
                        <a href="javascript:location.replace(location.href);" class="btn btn-primary btn-circle"
                           type="button" style="margin-bottom:0px;margin-right:10px;position:relative;top:-5px;"
                           title="刷新">
                            <i class="fa fa-refresh"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">
                    <form action="" method="post">
                        <div class="form-group col-sm-3" style="padding-left:0px;">

                            <input type="text" id="keywords" name="keywords" value="{$keywords}" placeholder="用户名"
                                   class="form-control" onkeyup="searchTitle(this);"/>
                        </div>
                        <button type="submit" class="btn btn-xm btn-primary">搜索</button>
                    </form>
                    <table style="word-break:break-all" id="mytable"
                           class="table table-striped table-bordered table-hover dataTables-example">
                        <thead>
                        <tr>
                            <th>ID</th>
                            <th>用户名</th>
                            <th>邮箱</th>
                            <th>数量</th>
                            <th>充值地址</th>
                            <th>图片</th>
                            <th>状态</th>
                            <th>创建时间</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <volist name="data" id="vo">
                            <?php $status = $vo->getData('status'); ?>
                            <tr class="gradeX" id="article-{$vo['id']}">
                                <td style="width: 80px">{$vo['id']}</td>
                                <td style="width: 180px">{$vo['uname']}</td>
                                <td style="width: 180px">{$vo['email']}</td>
                                <td style="width: 180px">{$vo['num']}</td>
                                <td style="width: 180px">{$vo['address']}</td>
                                <td class="center" align="center">
                                    <if condition="$vo['screenshot']">
                                        <a class="layui-btn" href="javascript:;" data-id="{$vo['screenshot']}"
                                           onclick="lookPhoto(this)">
                                            <img height="100" width="100" src="{$vo['screenshot']}"/>
                                        </a>
                                    </if>
                                </td>
                                <td style="width: 150px">
                                    <if condition="$vo['status'] eq 0">
                                        待审核
                                        <elseif condition="$vo['status'] eq 1"/>
                                            已充值
                                        <else/>
                                            充值失败
                                    </if>
                                </td>
                                <td style="width: 150px">{$vo['create_time']}</td>
                                <td style="width: 150px" class="center" align="center">
                                    <div class="btn-group">
                                        <button data-toggle="dropdown" class="btn btn-primary btn-xs dropdown-toggle"
                                                aria-expanded="false">操作 <span class="caret"></span>
                                        </button>
                                        <ul class="dropdown-menu">
                                            <if condition="$status eq 0">
                                                <if condition="check_auth('admin/Money/checkStatus')">
                                                    <li><a href="javascript:;" data-id="{$vo['id']}"
                                                           data-val="1"
                                                           class="font-bold yes-article">通过</a></li>
                                                    <li><a href="javascript:;" data-id="{$vo['id']}"
                                                           data-val="2"
                                                           class="font-bold yes-article">拒绝</a></li>
                                                </if>
                                            </if>
                                        </ul>
                                    </div>
                                </td>
                            </tr>
                        </volist>
                        </tbody>

                    </table>
                    {$page|raw}
                </div>
            </div>
        </div>
    </div>
</div>
<div id="img-model" class="modal fade" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <img src="" id="img-url" width="100%" height="60%">
        </div>
    </div>
</div>
<js href="/static/js/admin/jquery.min.js"/>
<js href="/static/js/admin/bootstrap.min.js"/>
<js href="/static/js/admin/content.min.js"/>
<js href="/static/js/admin/plugins/layui/layer/layer.js"/>
<script type="text/javascript" src="/static/js/admin/admincommon.js?v=20180820"></script>

<script>
    $(document).ready(function () {
        $(".ibox-content").on('click', '.yes-article', function () {
            var id = $(this).data("id");
            var val = $(this).data("val");
            layer.confirm("确定审核通过吗？", {
                btn: ['确定', '取消'] //按钮
            }, function () {
                $.post("{:url('admin/Money/checkRecharge')}", {orderId: id, status: val}, function (data) {
                    if (data.code == 200) {
                        layer.msg(data.msg, {time: 500, icon: 1});
                        window.location.replace(location.href);
                    } else {
                        layer.msg(data.msg, {time: 500, icon: 2});
                    }
                }, 'json');
            });
        });

        $(".ibox-content").on('click', '.edit-article', function () {
            var id = $(this).data("id");
            var addIndex = layer.open({
                title: '查看详情',
                offset: ['120px', '220px'],
                isOutAnim: true,
                type: 2,
                content: "{:url('admin/Money/getRechargeInfo')}?id=" + id,
                area: ['800px', '400px'],
                maxmin: true
            });

            layer.full(addIndex);

        });
    });

    function searchTitle(obj) {
        var keywords = $.trim($(obj).val());

        if (keywords.length <= 0) {
            window.location.replace(location.href);
        }
    }

    function lookPhoto(obj){
        var img= $(obj).attr('data-id');
        $("#img-url").attr('src', img);
        $("#img-model").modal('show');
    }

</script>

</body>
</html>
